<%@ page import="BL.AccessDB"%>
<%@ page import="BL.User"%>

<h2>Registrierung:</h2>

<%
	User[] usr = AccessDB.getUser();
	String springen = "registrieren";
	String usrText;
	if (request.getParameter("usr") != null) {
		usrText = request.getParameter("usr");
	} else {
		usrText = "";
	}
	HttpSession sess = request.getSession();
	if(sess.getAttribute("fehler") != null){
		if( sess.getAttribute("fehler") != "")
			out.print("<script>alert('"+sess.getAttribute("fehler")+"');</script>");
	} 
%>

<form method=post action="centralServlet">
	<input type="hidden" name=act value="<%=springen%>"></input>
	<table>
		<tr>
			<th align="left">User</th>
			<td><input type="text" name="usr" id="usr" value="<%=usrText%>"></input></td>
		</tr>
		<tr>
			<th align="left">Passwort</th>
			<td><input type="text" name="pwd" id="pwd"></input></td>
		</tr>
		<tr>
			<th align="left">Passwort wiederholen</th>
			<td><input type="text" name="pwdWdh" id="pwdWdh"></input></td>
		</tr>
		
			<input type="hidden" name="role" value="Member"></input>

		
		<td><input type="submit" name="userAct" value="User hinzufuegen"></input>
	</table>
</form>